package wt.hpad.utils;

import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;

import wt.hpad.MainApp;

/**
 * Created by wt on 17-8-17.
 */

public class DialogUtil {
    public static void showInToast(final Context context, final String text) {
        ThreadUtil.runOnUI(new Runnable() {
            @Override
            public void run() {
                Toast toast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
                toast.setText(text);
                toast.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 200);
                toast.show();
            }
        });
    }

    public static void showInToast(String text) {
        showInToast(MainApp.getContext(), text);
    }

    public static void showToastOnUI(final String text) {
        showInToast(MainApp.getContext(), text);
    }

}
